# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=uvicorn
pkgver=0.17.6
pkgrel=0
pkgdesc="Lightning-fast ASGI server"
url="https://www.uvicorn.org/"
license="BSD-3-Clause"
arch="noarch"
depends="
	python3
	py3-asgiref
	py3-click
	py3-h11
	"
makedepends="py3-setuptools"
checkdepends="
	py3-dotenv
	py3-httptools
	py3-httpx
	py3-pytest
	py3-pytest-asyncio
	py3-pytest-mock
	py3-yaml
	py3-trustme
	py3-watchgod
	py3-websockets
	py3-wsproto
	"
subpackages="$pkgname-doc"
source="https://github.com/encode/uvicorn/archive/$pkgver/uvicorn-$pkgver.tar.gz"

case "$CARCH" in
	# test suite blocked by py3-httpx
	armhf|ppc64le) options="!check" ;;
	# test suite blocked by py3-watchgod
	s390x) options="!check" ;;
esac

build() {
	python3 setup.py build
}

check() {
	pytest
}

package() {
	python3 setup.py install --root="$pkgdir" --skip-build

	install -Dm644 LICENSE.md "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.md
}

sha512sums="
d5c5223759d59648f279e22f7e6af728fe8117ed75488d125c1db3e5e9d385a50d574cff72ac46db4eb0a78d0e4f690096cfe78c774674dfba61860e55b7494e  uvicorn-0.17.6.tar.gz
"
